//
//  SingletonPatternTest.m
//  DesignPattern
//
//  Created by orvibo on 2018/12/29.
//  Copyright © 2018 Alic. All rights reserved.
//

#import "SingletonPatternTest.h"
#import "UserInfoManagerCenter.h"
#import "NewManagerCenter.h"

@implementation SingletonPatternTest

-(void)test{
    
    UserInfoManagerCenter *center = [UserInfoManagerCenter managerCenter];
    NSLog(@"%@", center.name);
    NSLog(@"%@", [UserInfoManagerCenter managerCenter]);
    //init 方法再也不能创建对象了，符合单例的单一对象原则
    NSLog(@"%@", [[UserInfoManagerCenter alloc] init]);
    
    
    //子类如果通过下面方法来创建的话，就会崩溃,你也可以简单看看crash日志
    //    [NewManagerCenter managerCenter];
}
@end
